<?php
defined('SEJUJOPEFDNGJSL') or exit('Access denied');

if($_POST['act']=='add'){
	$price=$_POST['price'];
	$zjz=$_POST['zjz'];
	if(!empty($zjz) && !is_numeric($zjz)){
		show_automsg('增加值不是数字,请重新填写',YMCURL.'configprice');
	}

	$num=$price+$zjz;
	
	
	$sql="INSERT INTO ld_coin_price (price,update_time)VALUES(".$num.",".time().")";

	$db->sitedbexec($sql);
	record_log('更新价格');
	show_automsg('修改系统参数成功！',YMCURL.'configprice');
}
$db->query("select * from ld_coin_price order by update_time desc limit 1",2);
$rs=$db->rs;



echo '<h3>价格设置</h3>';
echo '<div class="main-r-body"><form method="post" action="'.geturl().'">
		<div class="main-r-item">
		<input type="submit" class="thabtn" value="保存"></div>
		<input type="hidden" name="act" value="add">';
echo '<table class="tregtab ttab">';

// var_dump($GLOBALARR);
echo '<tr>
		<td class="wdb20 alignr paddingr">当前价格</td>
		<td class="alignl paddingl"><input type="text"  name="price" value="'.$rs['price'].'" class="thconfig wd120" readonly="readonly">元</td>
	  </tr>';
echo '<tr>
		<td class="wdb20 alignr paddingr">变动值</td>
		<td class="alignl paddingl"><input type="text" name="zjz" value="" class="thconfig wd120">元</td>
	  </tr>';




echo '</table>';
echo '</form></div>';

?>